<div class="col-lg-12">
    @include('admin.contents.bar')
    <section class="panel">
        <header class="panel-heading">List <i class="fa fa-info-sign text-muted" data-toggle="popover" data-html="true" data-placement="top" data-content="The datatables use ajax to load the data. please put this file on a server to preview." title="" data-trigger="hover" data-original-title="Help"></i> 
            <a class="btn btn-sm btn-info pull-right" href="{{ URL::to('admin/contents/create') }}"><i class="fa fa-fw fa-plus"></i> New Content</a>
        </header>
       @if (Session::has('success') )
            <div class="alert alert-success">
            {{ Session::get('success') }}
            </div>
        @endif
        @if (Session::has('error') )
            <div class="alert alert-error">
            {{ Session::get('error') }}
            </div>
        @endif
        <div class="table-responsive">
            <table class="table table-striped m-b-none" data-ride="datatables">
                <thead>
                    <tr>
                        <th width="5%">contentID</th>
                        <th width="55%">title</th>
                        <th width="10%">active</th>
                        <th width="15%">created_at</th>
                        <th width="15%"></th>
                    </tr>
                </thead>
                <tbody>
	                @foreach($contents as $key => $value)
	                    <tr>
	                        <td>{{$value->contentID}}</td>
	                        <td>{{$value->title}}</td>
	                        <td>                            
                                <a href="#" @if($value->active=='Y') class="active" @endif>
        	                        @if($value->active=='Y')
    	                                <i class="fa fa-check fa-lg text-success text-active"></i>
    	                            @else
            	                        <i class="fa fa-times fa-lg text-danger text"></i>
	                                @endif
                                </a>
                            </td>
	                        <td>{{$value->created_at}}</td>
	                        <td class="td-actions">
	                            <a class="btn btn-small btn-primary" href="{{ URL::route('admin.contents.edit', $value->contentID)}}"><i class="fa fa-edit"></i></a><!--
                				-->{{ Form::open(array('route' => array('admin.contents.destroy', $value->contentID), 'method' => 'delete', "class"=>"pull-right")) }}
                                       <button class="btn btn-small btn-danger"><i class="fa fa-trash-o"></i></button>
                                   {{ Form::close() }}<!--</i></a>-->
                            </td>
	                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </section>
</div>
@section('extra-javascript')
{{ HTML::script('js/datatables/jquery.dataTables.min.js')}}
<script>
// datatable
$('[data-ride="datatables"]').each(function() {
	var oTable = $(this).dataTable( {
		"sDom": "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col col-sm-6'p>>",
		"sPaginationType": "full_numbers"
	} );
});
</script>
@stop
